package org.alex.nettychat.javaIO;

import java.net.Socket;
import java.time.LocalDateTime;

/**
 * 传统IO客户端的实现
 * @author : alex
 */
public class IOClient {
    public static void main(String[] args) {
        new Thread(()->{
            try {
                Socket socket = new Socket("127.0.0.1", 8000);
                while (true) {
                    socket.getOutputStream().write((LocalDateTime.now() +": hello world").getBytes());
                    Thread.sleep(2000);
                }
            } catch (Exception e) {

            }

        }).start();
    }
}
